<?php

// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');

// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return array(
	'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
	'name'=>'My Web Application',

	// preloading 'log' component
	'preload'=>array('log'),

	// autoloading model and component classes
	'import'=>array(
		'application.models.*',
		'application.components.*',
	    'application.modules.srbac.controllers.SBaseController',
	),
    'language' => 'zh-cn',//加个中文显示
	'modules'=>array(
		// uncomment the following to enable the Gii tool
		'admin',
		'gii'=>array(
			'class'=>'system.gii.GiiModule',
			'password'=>'admin',
			// If removed, Gii defaults to localhost only. Edit carefully to taste.
			'ipFilters'=>array('127.0.0.1','::1'),
		),
        'srbac'=> array(
                'userclass'=>'User',      //用户model名字段
                'userid'=>'id',            //用户表user_id的标识字段
                'username'=>'username',    //用户表username的标识字段
                'delimeter'=>'/',          //控制器名和方法的分割线（在Srbac模块中的体现）
                'debug'=>false,             //debug模式为真，Srbac模块失效，debug模式为假，Srbac模块工作
                'pageSize'=>10,            //Srbac模块中的分页设置
                'superUser' =>'Authority', // Srbac中最高权限管理者名称
                'css'=>'srbac.css',        //Srbac加载的CSS样式
                'layout'=>'application.views.layouts.mycolumn',
                //'layout'=>'application.modules.admin.views.layouts.mycolumn',   //Srbac模块展现的主题模版
                'notAuthorizedView'=>'srbac.views.authitem.unauthorized',   //非自动验证视图
                'alwaysAllowed'=>array(    //默认不分权限管理的action动作
                        'SiteLogin','SiteLogout','SiteIndex','SiteAdmin',
                        'SiteError', 'SiteContact',
                ),
                'userActions'=>array('Show','View','List'),     //User 默认的动作
                'listBoxNumberOfLines' => 15,                  //Srbac模块中的listbox分页
                'imagesPath' => 'srbac.images',                //Srbac模块加载图文件夹
                'imagesPack'=>'tango',                         //Srbac模块主题的风格noia，tango两种
                'iconText'=>true,                              //图片上显示文本，为真有文本，为假只有图标
                'header'=>'srbac.views.authitem.header',   //Srbac模块视图的view头部
                'footer'=>'srbac.views.authitem.footer',   //Srbac模块视图的view页尾
                'showHeader'=>true,      //显示视图头部
                'showFooter'=>true,      //显示视图尾部
                'alwaysAllowedPath'=>'srbac.components',   //默认加载Srbac的核心文件地址
        
        ),
	        
	),

	// application components
	'components'=>array(
    	'authManager' => array(
    	        'class' => 'srbac.components.SDbAuthManager',
    	        'connectionID' => 'db',
    	        'itemTable' => 'authitems',
    	        'assignmentTable' => 'authassignments',
    	        'itemChildTable' => 'authitemchildren',
    	),
    	'clientScript' => array(
    	        'scriptMap' => array(
    	                //'jquery.js' => false,
    	                //'jquery.min.js' => false,//不加载系统自带的jquery
    	        ),
    	        'coreScriptPosition' => CClientScript::POS_END,
    	),
		'user'=>array(
			// enable cookie-based authentication
			'allowAutoLogin'=>true,
		),
		// uncomment the following to enable URLs in path-format
		/*
		'urlManager'=>array(
			'urlFormat'=>'path',
			'rules'=>array(
				'<controller:\w+>/<id:\d+>'=>'<controller>/view',
				'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
				'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
			),
		),
		*/
		/*
		'db'=>array(
			'connectionString' => 'sqlite:'.dirname(__FILE__).'/../data/testdrive.db',
		),
		// uncomment the following to use a MySQL database
		*/
		'db'=>array(
			'connectionString' => 'mysql:host=localhost;dbname=db_cms',
			'emulatePrepare' => true,
			'username' => 'root',
			'password' => '',
			'charset' => 'utf8',
			'tablePrefix' =>'tbl_',
		),
		'errorHandler'=>array(
			// use 'site/error' action to display errors
			'errorAction'=>'site/error',
		),
		'log'=>array(
			'class'=>'CLogRouter',
			'routes'=>array(
				array(
					'class'=>'CFileLogRoute',
					'levels'=>'error, warning',
				),
				// uncomment the following to show log messages on web pages
				/*
				array(
					'class'=>'CWebLogRoute',
				),
				*/
			),
		),
	),

	// application-level parameters that can be accessed
	// using Yii::app()->params['paramName']
	'params'=>array(
		// this is used in contact page
		'adminEmail'=>'webmaster@example.com',
	),
	
);